@mixin activeItem() {
  @apply text-theme border;
  border-color: var(--theme-color);
  background-color: rgba(255, 128, 50, 0.2);
}

.switch {
  @apply flex;
  height: 1.875rem;

  .item {
    @apply flex h-full items-center justify-center border border-solid text-white-60 text-lg cursor-pointer;
    width: 4.625rem;
    border-color: rgba(255, 255, 255, 0.4);

    & > img {
      @apply mr-1;
      width: 0.875rem;
      height: 0.875rem;
    }

    &:first-child {
      border-top-left-radius: 0.25rem;
      border-bottom-left-radius: 0.25rem;
      border-right-width: 0;
    }

    &:last-child {
      border-top-right-radius: 0.25rem;
      border-bottom-right-radius: 0.25rem;
      border-left-width: 0;
    }

    &.active1 {
      @include activeItem();

      & > img {
        content: url('/images/recommend-active.png');
      }
    }

    &.active2 {
      @include activeItem();

      & > img {
        content: url('/images/all-active.png');
      }
    }
  }
}

// 移动端
@media screen and (max-width: 767px) {
  .switchPhone {
    @apply h-6;

    .item {
      width: 3.75rem;

      & > img {
        width: 0.625rem;
        height: 0.625rem;
      }

      & > span {
        @apply text-xs;
      }
    }
  }
}
